.w-slider {
  position: relative;
  display: flex;
  align-items: center;
  user-select: none;

  // Slider label, left & right.
  // ------------------------------------------------------
  &__label--left {
    margin-right: 3 * $base-increment;
  }
  &__label--right {
    margin-left: 3 * $base-increment;
  }

  // Steps labels.
  // ------------------------------------------------------
  &--has-step-labels {
    padding-bottom: 4 * $base-increment;
  }
  &__step-labels {
    position: absolute;
    top: 0;
    display: flex;
    width: 100%;
  }

  &__step-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.8em;
    padding-top: 2 * $base-increment;
    color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    cursor: pointer;

    &:before {
      content: "";
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      top: 0;
      width: $base-increment;
      height: $base-increment;
      background-color: rgba(0, 0, 0, 0.2);
      border-radius: 9em;
      // box-shadow: 0 0 0 1px #fff;
      box-sizing: border-box;
      pointer-events: none;
    }
    &:first-child:before,
    &:last-child:before {
      display: none;
    }
  }

  // Track.
  // ------------------------------------------------------
  &__track-wrap {
    position: relative;
    flex-grow: 1;
  }

  &__track {
    position: relative;
    flex-grow: 1;
    height: $slider-height;
    background-color: $slider-track-color;
    -webkit-tap-highlight-color: transparent;
    border-radius: $border-radius;
    touch-action: none;
    cursor: pointer;

    .w-slider--disabled &,
    .w-slider--readonly & {
      cursor: not-allowed;
      touch-action: initial;
    }

    &:before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      // For fat fingers.
      top: -8px;
      bottom: -8px;
    }
  }

  // Range.
  // ------------------------------------------------------
  &__range {
    position: absolute;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 1;
    transition: $transition-duration;
    border-radius: inherit;

    .w-slider--dragging & {
      transition: none;
    }
    .w-slider--disabled & {
      opacity: 0.35;
    }
  }

  // Thumb.
  // ------------------------------------------------------
  &__thumb {
    position: absolute;
    width: 3 * $base-increment;
    height: 3 * $base-increment;
    left: 100%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: $transition-duration;

    .w-slider--dragging & {
      transition: none;
    }
  }

  &__thumb-button {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 9em;
    cursor: pointer;
    background-color: #fff;

    .w-slider--disabled &,
    .w-slider--readonly & {
      cursor: auto;
    }

    &:before,
    &:after {
      content: "";
      position: absolute;
    }
    &:before {
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      opacity: 0.5;
      border-radius: inherit;
      border: 1px solid currentColor;
      @include default-transition;
    }
    &:hover:before,
    &:focus:before {
      opacity: 0.7;
    }
    &:active:before,
    .w-slider--dragging &:before {
      opacity: 1;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
      transition-duration: $fast-transition-duration;
    }
    .w-slider--disabled &:before,
    .w-slider--readonly &:before {
      box-shadow: none;
      opacity: 0.4;
    }

    // For fat fingers.
    &:after {
      left: -6px;
      right: -6px;
      top: -6px;
      bottom: -6px;
    }
  }

  // Thumb label.
  // ------------------------------------------------------
  &__thumb-label {
    position: absolute;
    left: 50%;
    bottom: 100%;
    margin-bottom: round(3 * $base-increment);
    transform: translateX(-50%);
    padding: round(0.75 * $base-increment) (2 * $base-increment);
    background-color: #fff;
    border-radius: $border-radius;
    border: $border;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
    font-size: 0.85em;
    color: rgba(0, 0, 0, 0.7);

    &:before,
    &:after {
      content: "";
      position: absolute;
      top: 100%;
      left: 50%;
      transform: translateX(-50%);
      width: 0;
      height: 0;
      border: solid transparent;
    }

    &:before {
      border-width: 7px;
      border-top-color: inherit;
    }
    &:after {
      border-width: 6px;
      border-top-color: #fff;
    }

    &--droplet {
      transform: translateX(-50%) rotate(-45deg);
      border-radius: 9em 9em 9em 0;
      width: 2.8em;
      height: 2.8em;

      & > div {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        transform: rotate(45deg);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1em;
      }

      &:before,
      &:after {
        display: none;
      }
    }
  }
}
